/*    */ package com.jcrj.dao.imp;
/*    */ 
/*    */ import com.jcrj.dao.HolidayDao;
/*    */ import com.jcrj.entity.OHoliday;
/*    */ import com.jcrj.entity.OLeave;
/*    */ import java.util.Date;
/*    */ import org.springframework.orm.hibernate3.HibernateTemplate;
/*    */ 
/*    */ public class HolidayDaoImp extends AbstractBaseDaoImp
/*    */   implements HolidayDao
/*    */ {
/*    */   public void saveHoliday(String days, int userId, int instanceId)
/*    */   {
/* 12 */     OHoliday holiday = new OHoliday();
/* 13 */     holiday.setCreateTime(new Date());
/* 14 */     holiday.setDays(days);
/* 15 */     holiday.setUserId(Integer.valueOf(userId));
/* 16 */     holiday.setInstanceId(Integer.valueOf(instanceId));
/* 17 */     getHibernateTemplate().save(holiday);
/*    */   }
/*    */ 
/*    */   public void saveLeave(String days, int userId, String type, int instanceId) {
/* 21 */     OLeave leave = new OLeave();
/* 22 */     leave.setCreateTime(new Date());
/* 23 */     leave.setInstanceId(Integer.valueOf(instanceId));
/* 24 */     leave.setUserId(Integer.valueOf(userId));
/* 25 */     leave.setType(type);
/* 26 */     if ("1".equals(type)) {
/* 27 */       leave.setDays1(days);
/* 28 */       leave.setDays2("0");
/* 29 */       getHibernateTemplate().save(leave);
/* 30 */     } else if ("2".equals(type)) {
/* 31 */       leave.setDays1("0");
/* 32 */       leave.setDays2(days);
/* 33 */       getHibernateTemplate().save(leave);
/*    */     }
/*    */   }
/*    */ }

/* Location:           /Volumes/work/oa/WEB-INF/classes/
 * Qualified Name:     com.jcrj.dao.imp.HolidayDaoImp
 * JD-Core Version:    0.6.0
 */